package day05.homework.expand;

import java.util.Random;

public class PrintArrayDemo {
    public static void main(String[] args) {
        //定义一个printArrayData()，用于输出整型数组的每一个元素的值，测试方法
        int[] arr1 = new int[]{21,5,1,2,4,5};
        printArrayData(arr1);

        System.out.println();

        int[] arr2 = new int[10];
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = new Random().nextInt(100);
        }
        printArrayData(arr2);
    }

    public static void printArrayData(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}
